<template>
  <div class="child">
    <h1>这是子组件</h1>
    <h4>玩具</h4>
    <button @click="emit('send-toy', toy)">发送玩具</button>
  </div>
</template>

<script setup lang="ts" name="Child">
import { ref } from "vue";
const toy = ref('奥特曼')

const emit = defineEmits(['send-toy'])
</script>